package design_pattern.decorator.test4;

/**
 * Created by WeiDingKuo on 2017/10/25 15:06
 */
public class Decorator1 extends ComponentImpl {
    private ComponentImpl component;

    public Decorator1(ComponentImpl component) {
        this.component = component;
    }

    @Override
    public void dosomething() {
        befor();
        this.component.dosomething();
        after();
    }

    private void befor() {
        System.out.println("decorator befor");
    }

    private void after() {
        System.out.println("decorator after");
    }
}
